<?php

class Control_Model_Form_Register extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('registration');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');

        $user = new Zend_Form_Element_Text('user');
        $user->setLabel('Username:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $password1 = new Zend_Form_Element_Password('password1');
        $password1->setLabel('Password:')
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->setAttrib('size', 50);

        $password2 = new Zend_Form_Element_Password('password2');
        $password2->setLabel('Re-tupe password:')
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->setAttrib('size', 50);

        $Name = new Zend_Form_Element_Text('Name');
        $Name->setLabel('First name:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $Soname = new Zend_Form_Element_Text('Soname');
        $Soname->setLabel('Second name:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');

        $this->addElements(array($id, $user, $password1, $password2, $Name, $Soname, $submit));
    }
}